﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true"
    CodeFile="WishZhuanTi_Mode.aspx.cs" Inherits="Manage_WishZhuanTi_Mode" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/css/colorpicker.css") %>" />
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/colorpicker.js")%>'></script>
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/css/glDatePicker.flatwhite.css") %>" />
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/glDatePicker.min.js")%>'></script>
    <style type="text/css">
        #xuzt_mode_table
        {
            width: 99%;
            border-collapse: collapse;
            empty-cells: show;
            margin-left: 8px;
            margin-top: 10px;
            margin-bottom: 20px;
        }
        #xuzt_mode_table tr
        {

            background: #f6f6f6;
        }
        #xuzt_mode_table tr td
        {
            border: #d8d8d8 1px solid;
            vertical-align: middle;
        }
        #xuzt_mode_table tr .tdl
        {
            width: 110px;
            text-align: right;
            padding-right: 15px;
        }
        #xuzt_mode_table tr .tdr
        {
            padding: 15px;
        }
        .color
        {
            width:60px;
        }
        .date
        {
            width:200px;
        }
    </style>
    <script type="text/javascript">
        jQuery(document).ready(
            function () {
                $('[id$=ZhuanTiData_tb]').glDatePicker({
                    //初始化日历空间
                    cssName: 'flatwhite',
                    showAlways: false,
                    format: 'yyyy-mm-dd'
                });
                $('.color').each(function () {
                    if ($(this).val() != "") {
                        $(this).css("background-color", "#" + $(this).val());
                    }
                });
                $('.color').ColorPicker({
                    //拾色器
                    onSubmit: function (hsb, hex, rgb, el) {
                        $(el).val(hex);
                        $(el).css("background-color", "#" + hex);
                        $(el).ColorPickerHide();
                    },
                    onBeforeShow: function () {
                        $(this).ColorPickerSetColor(this.value);
                    }
                })
	            .bind('keyup', function () {
	                $(this).ColorPickerSetColor(this.value);
	            });
            }
        );

	    var check_ZhuanTiName = function () {
	        if (jQuery("[id$=ZhuanTiName_tb]").val().length == 0) {
	            alert("请输入专题名称");
	            return false;
	        }
	        return true;
	    }
	    var check_ZhuanTiData = function () {
	        if (jQuery("[id$=ZhuanTiData_tb]").val().length == 0) {
	            alert("请选择活动时间");
	            return false;
	        }
	        return true;
	    }
	    var check_submit = function () {
	        //提交验证输入是否正确
	        if (!check_ZhuanTiName())
	            return false;
	        if (!check_ZhuanTiData())
	            return false;
	        return true;
	    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="zhuantiID_hf" runat="server" />
    <asp:HiddenField ID="picguid_hf" runat="server" />
    <table id="xuzt_mode_table">
        <tr style="height: 25px; background: url('images/tt_x.gif') repeat-x;">
            <td colspan="2" style="padding-left: 8px;">
                新建许愿墙专题
            </td>
        </tr>
        <tr>
            <td class="tdl">
                专题名称:
            </td>
            <td class="tdr">
                <asp:TextBox ID="ZhuanTiName_tb" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                顶部图片:
            </td>
            <td class="tdr">
                <asp:HiddenField ID="BunnerImg_hf" runat="server" />
                <asp:Image ID="BunnerImg_img" Visible="false" runat="server" Width="300px" /><br />
                <asp:FileUpload ID="BunnerImg_up_fu" runat="server" />
                <asp:Button ID="BunnerImg_up_btn" runat="server" Text="上传图片" 
                    onclick="BunnerImg_up_btn_Click" style=" margin-left:50px;" />&nbsp;&nbsp;(请用ps等软件把图片宽度设置为900px)
            </td>
        </tr>
        <tr>
            <td class="tdl">
                背景样式:
            </td>
            <td class="tdr">
                <asp:RadioButtonList ID="Background_rbl" runat="server" BorderStyle="None" 
                    RepeatLayout="Flow" RepeatDirection ="Horizontal"  AutoPostBack="true"
                    OnSelectedIndexChanged="Background_SelectedIndexChanged" >
                    <asp:ListItem Selected="True">
                        纯颜色
                    </asp:ListItem>
                    <asp:ListItem>
                        图片加颜色
                    </asp:ListItem>
                </asp:RadioButtonList>
                <br /><br />
                背景颜色：<asp:TextBox ID="Background_tb" runat="server" CssClass="color" Text="bf6839"></asp:TextBox>
                <br /><br />
                <asp:Panel ID="Background_pl" runat="server" Visible="false">
                    背景重复：
                    <asp:DropDownList ID="Background_ddl" runat="server">
                        <asp:ListItem>no-repeat</asp:ListItem>
                        <asp:ListItem>repeat</asp:ListItem>
                        <asp:ListItem>repeat-x</asp:ListItem>
                        <asp:ListItem>repeat-y</asp:ListItem>
                    </asp:DropDownList>
                    <br /><br />
                    <asp:HiddenField ID="Background_hf" runat="server" />
                    <asp:Image ID="Background_img" Visible="false" runat="server" Width="300px" /><br />
                    <asp:FileUpload ID="Background_up_fu" runat="server" />
                    <asp:Button ID="Background_up_btn" runat="server" Text="上传图片" 
                        onclick="Background_up_btn_Click" style=" margin-left:50px;" />&nbsp;&nbsp;
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                活动时间:
            </td>
            <td class="tdr">
                <asp:TextBox ID="ZhuanTiData_tb" CssClass="date" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                内容背景:
            </td>
            <td class="tdr">

                <asp:RadioButtonList ID="ConBackground_rbl" runat="server" BorderStyle="None" 
                    RepeatLayout="Flow" RepeatDirection ="Horizontal"  AutoPostBack="true"
                    OnSelectedIndexChanged="ConBackground_rbl_SelectedIndexChanged" >
                    <asp:ListItem Selected="True">
                        纯颜色
                    </asp:ListItem>
                    <asp:ListItem>
                        图片加颜色
                    </asp:ListItem>
                </asp:RadioButtonList>
                <br /><br />
                背景颜色：<asp:TextBox ID="ConBackground_tb" runat="server"  CssClass="color" Text="CfB2A3"></asp:TextBox>
                <br /><br />
                <asp:Panel ID="ConBackground_pl" runat="server" Visible="false">
                    背景重复：
                    <asp:DropDownList ID="ConBackground_ddl" runat="server">
                        <asp:ListItem>no-repeat</asp:ListItem>
                        <asp:ListItem>repeat</asp:ListItem>
                        <asp:ListItem>repeat-x</asp:ListItem>
                        <asp:ListItem>repeat-y</asp:ListItem>
                    </asp:DropDownList>
                    <br /><br />
                    <asp:HiddenField ID="ConBackground_hf" runat="server" />
                    <asp:Image ID="ConBackground_img" Visible="false" runat="server" Width="300px" /><br />
                    <asp:FileUpload ID="ConBackground_up_fu" runat="server" />
                    <asp:Button ID="ConBackground_up_btn" runat="server" Text="上传图片" 
                         style=" margin-left:50px;" onclick="ConBackground_up_btn_Click" />&nbsp;&nbsp;
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                文字颜色:
            </td>
            <td class="tdr">
                 <asp:TextBox ID="FontColor_tb" runat="server"  CssClass="color" Text="774a31"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                赞助商名称:
            </td>
            <td class="tdr">
                <asp:TextBox ID="SponsorName_tb" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdl">
                赞助商链接:
            </td>
            <td class="tdr">
                <asp:TextBox ID="SponsorLink_tb" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdl">
            </td>
            <td class="tdr">
                <asp:Button ID="submit_btn" runat="server" Text="创建专题" OnClientClick="return check_submit();" Style="float: right;" />
            </td>
        </tr>
    </table>
</asp:Content>
